<?php
class Info_shareAction extends IntesysAction {
	function index(){
        //筛选结果并显示
		$this->initView();
        $this->dao=D('Info');
		$this->dao->filter('share',$this->view);
		
       //获取 筛选或添加 部门，所有员工等数据
       $membergroup=D('Member_group')->getGroup();
       $this->assign('grouplist',$membergroup);
       $staff=D('Member')->getallgroupmember();
       $this->assign('memberlist',$staff);
       
       if($_POST['requestType']==10011001){
           die(json_encode(array('share'=>$list,'statu'=>1)));
       }else{
           $this->display();    
       }
	}
	public function update(){
        $this->dao=$this->dao = D('Info');
		if($this->_get('id')){
            $_POST['id']=$this->_get('id');
            if(isset($_POST['content'])){
                //$_POST['content']=str_replace(array("\r\n","\n","\r"),'<br/>',strip_tags($_POST['content']));
            }
			parent::update();
		}
	}
	public function insert(){
        if(IS_POST){
            $this->dao=$this->dao = D('Info');
            $_POST['site_id'] =__SITEID__;
            if($_POST['type']!=0||!isset($_POST['type']))$_POST['type']='share';
            $_POST['datetime']=time();
            $_POST['member_id']=session(C('USER_AUTH_KEY'));
            //$_POST['content']=str_replace(array("\r\n","\n","\r"),'<br/>',strip_tags($_POST['content']));
            parent::insert();
        }
	}
	public function delete(){
        $this->dao=$this->dao = D('Info');
		if($this->_get('id')){
			parent::delete();
		}
	}
}

